Skip to content

fix(tui): prevent spinner garbage in non-TTY environments#29601

Open
imtiazNDMA wants to merge 1 commit into
anomalyco:devfrom
imtiazNDMA:fix/non-tty-spinner
Open

fix(tui): prevent spinner garbage in non-TTY environments#29601
imtiazNDMA wants to merge 1 commit into
anomalyco:devfrom
imtiazNDMA:fix/non-tty-spinner

Conversation

@imtiazNDMA
Copy link
Copy Markdown

@imtiazNDMA imtiazNDMA commented May 27, 2026

Issue for this PR

Closes #27908

Type of change

  • Bug fix

What does this PR do?

The plugin install spinner from @clack/prompts outputs ANSI escape sequences unconditionally. When stdout is not a TTY (CI, subprocess, piped output), carriage return and CSI sequences appear as garbage text.

Added a TTY-aware spinner wrapper that falls back to plain console.log/console.error when stdout is not a terminal.

How did you verify your code works?

  • bun typecheck (clean)
  • bun test test/skill/ (22 pass)
  • bun test test/tool/skill.test.ts (2 pass)
  • bun test test/cli/cmd/ (50 pass)

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

The plugin install spinner from @clack/prompts outputs ANSI escape
sequences unconditionally. When stdout is not a TTY (CI, subprocess,
piped output), \r and CSI sequences appear as garbage.

Added a TTY-aware spinner wrapper that falls back to plain
console.log/console.error when stdout is not a terminal.

Fixes anomalyco#27908
@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label May 27, 2026
@github-actions
Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

Found potential related PRs:

  1. PR fix(opencode): avoid spinner noise in non-tty plugin install #28944 - fix(opencode): avoid spinner noise in non-tty plugin install
  2. PR fix: use static plugin spinner outside TTY #27951 - fix: use static plugin spinner outside TTY

Both of these PRs appear to be addressing the same issue: preventing spinner garbage output when stdout is not a TTY. They may already be closed or merged, but you should check if PR #29601 is actually a duplicate or if it's solving a remaining edge case that wasn't fully addressed by the previous attempts.

@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label May 27, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

plugin install spinner outputs garbage in non-TTY environment

1 participant